package com.lgx.mall.view.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import net.sf.json.JSONObject;

import com.lgx.common.entity.IdGenerator;
/**
 * 前台菜单功能明细
 * 
 * @author hz
 *
 */
@Entity
@Table(name="TV_WEBPAGE_DETAIL")
public class WebPageDetail implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6737807358223259903L;

	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator=IdGenerator.TV_WEBPAGE_DETAIL_ID)
	@TableGenerator(
			name = IdGenerator.TV_WEBPAGE_DETAIL_ID,
			table = IdGenerator.GENERATOR_TABLE,
			pkColumnName = IdGenerator.GEN_NAME,
			pkColumnValue = IdGenerator.TV_WEBPAGE_DETAIL_ID,
			valueColumnName = IdGenerator.GEN_VALUE,
			initialValue = 1,
			allocationSize = 1
	)
	private long id;
	
	/**
	 * 对应实体ID（商品、品牌、广告、商家、说明）
	 */
	private String entityId;
	
	/**
	 * 对应实体URL
	 */
	private String entityUrl;
	
	/**
	 * 对应实体名称
	 */
	private String entityName;
	
	/**
	 * 0商品、1品牌、2广告、3新闻、4公告、5规则、6商家、7说明、8分类
	 */
	private Integer type;
	
	@Column(name="category_id")
	private long categoryId;
	
	/**
	 * 排序号
	 */
	private String layerOrder;
	
	/**
	 * 区域编号
	 */
	private String areaNode;
	
	/**
	 * 图片URL1
	 */
	private String imageUrl1;
	
	/**
	 * 图片URL2
	 */
	private String imageUrl2;
	
	private String isDelete;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getEntityId() {
		return entityId;
	}

	public void setEntityId(String entityId) {
		this.entityId = entityId;
	}

	public String getEntityUrl() {
		return entityUrl;
	}

	public void setEntityUrl(String entityUrl) {
		this.entityUrl = entityUrl;
	}

	public String getEntityName() {
		return entityName;
	}

	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(long categoryId) {
		this.categoryId = categoryId;
	}

	public String getLayerOrder() {
		return layerOrder;
	}

	public void setLayerOrder(String layerOrder) {
		this.layerOrder = layerOrder;
	}

	public String getAreaNode() {
		return areaNode;
	}

	public void setAreaNode(String areaNode) {
		this.areaNode = areaNode;
	}

	public String getImageUrl1() {
		return imageUrl1;
	}

	public void setImageUrl1(String imageUrl1) {
		this.imageUrl1 = imageUrl1;
	}

	public String getImageUrl2() {
		return imageUrl2;
	}

	public void setImageUrl2(String imageUrl2) {
		this.imageUrl2 = imageUrl2;
	}

	public String getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(String isDelete) {
		this.isDelete = isDelete;
	}

	@Override
	public String toString() {
		JSONObject obj = new JSONObject();
		
		obj.put("id", this.getId());
		obj.put("entityId", this.getEntityId());
		obj.put("entityUrl", this.getEntityUrl());
		obj.put("entityName", this.getEntityName());
		obj.put("imageUrl1", this.getImageUrl1());
		obj.put("imageUrl2", this.getImageUrl2());
		
		return obj.toString();
	}
}
